package com.huabo.system.oracle.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.system.oracle.entity.TblMonitorModel;

public class TblMonitorModelMapperSqlConfig {


    public String findByModelJKZX(String solutionid, PageInfo<TblMonitorModel> pageInfo) {
        StringBuffer sbSql = new StringBuffer("SELECT * FROM ( SELECT BUDGET.*,ROWNUM RNUM FROM ( SELECT * from TBL_MONITOR_MODEL TMM LEFT JOIN TBL_MONITOR_SOLUTION_MODEL TMSM ON TMM.MODELID = TMSM.MODELID LEFT JOIN TBL_MONITOR_SOLUTION TMS ON TMSM.SOLUTIONID = TMS.SOLUTIONID WHERE TMS.SOLUTIONID = "+ solutionid);

        sbSql.append(" ) BUDGET WHERE rownum <= "+(pageInfo.getCurrentPage()*pageInfo.getPageSize())+" ) WHERE RNUM > "+pageInfo.getCurrentRecord());
        String sql = sbSql.toString();
        return sql;
    }
}
